home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWFiles / Include / FWFileAc.h next >
Encoding:
Text File  |  1996-04-25  |  1.6 KB  |  63 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFileAc.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWFILEAC_H
  11. #define FWFILEAC_H
  12.  
  13. #ifndef FWRANSIN_H
  14. #include "FWRanSin.h"
  15. #endif
  16.  
  17. #include "SLFileAc.xh"
  18.  
  19. //========================================================================================
  20. //    CLASS FW_PFileSink
  21. //
  22. //        Inherited API for operator->()
  23. //            long GetReadableBytes();
  24. //            void Read(in void * destination, in long count);
  25. //            long GetWritableBytes();
  26. //            void Write(in void* source, in long count);
  27. //
  28. //            long GetLength();
  29. //            void SetLength(in long length);
  30. //            long GetPosition();
  31. //            void SetPosition(in long position);
  32. //
  33. //        New API for operator->()
  34. //            FW_OFile GetOFileRep();
  35. //
  36. //========================================================================================
  37.  
  38. class FW_PFileSink : public FW_PRandomAccessSink
  39. {
  40. public:
  41.     FW_PFileSink(Environment* ev, FW_OFileSink* theFileSink);
  42.     FW_PFileSink(Environment* ev, FW_OFile* theFile);
  43.  
  44.     virtual ~FW_PFileSink();
  45.  
  46.     FW_OFileSink* operator->() const;
  47.  
  48. private:
  49.     FW_PFileSink(const FW_PFileSink&);
  50.     FW_PFileSink& operator=(const FW_PFileSink&);
  51. };
  52.  
  53.  
  54. //----------------------------------------------------------------------------------------
  55. //    FW_PFileSink::operator->
  56. //----------------------------------------------------------------------------------------
  57. inline FW_OFileSink* FW_PFileSink::operator->() const
  58. {
  59.     return (FW_OFileSink*)GetRep();
  60. }
  61.  
  62. #endif
  63.